#pragma once

#include <bits/stdint-uintn.h>
#include <faiss/Index.h>
#include <vector>

class FaissIndex {
public:
    FaissIndex(faiss::Index* index);
    /**
     * @brief insert vectors to the index
     *
     * @param data vector<float> vector that needed to insert
     *        label uint64_t the label of the vector
     */
    void insert_vectors(const std::vector<float>& data, uint64_t label);
    
    /**
     * @brief search k vectors that have the minist distances to the query
     * @param: query vector<float> 
     *         k int
     * @return pair
     *         first vector: the labels of the searched vectors
     *         second: the distances
     */
    std::pair<std::vector<long>, std::vector<float>> 
        search_vectors(const std::vector<float>& query, int k);
private:
    faiss::Index* index;
};
